
var http = require('http')

var url = require('url')

var router = require('./Model/router2')

http.createServer(function (req,res) {

    res.writeHead(200,{"Content-Type":"text/html;charset='utf-8'"})

    var pathname = url.parse(req.url).pathname.replace('/','')
    
    if (pathname != 'favicon.ico') {
        try {
            console.log('222')
            router[pathname](req,res)
        }catch (e) {
            console.log(e)
            router['home'](req,res)
        }
    }

}).listen(8008)